﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace SimpleTranslateResourceProvider
{
    public class LocalizeValueDictionary : Dictionary<String, object>
    {
        public LocalizeValueDictionary()
        {

        }

        public LocalizeValueDictionary(LocalizeValueDictionary parameters)
        {
            this.Concat(parameters);
        }

        public LocalizeValueDictionary(object parameters)
        {
            if (parameters == null) return;

            var properties = System.ComponentModel.TypeDescriptor.GetProperties(parameters);
            foreach (PropertyDescriptor property in properties)
            {
                this.Add(property.Name, property.GetValue(parameters));
            }
        }
    }
}
